Integrand size = 28, antiderivative size = 39 \[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\left (a^2-b^2\right ) x-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3165, 3558, 3556} \[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=x \left (a^2-b^2\right )-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d} \]
[In]
[Out]
Rule 3165
Rule 3556
Rule 3558
Rubi steps \begin{align*} \text {integral}& = \int (a+b \tan (c+d x))^2 \, dx \\ & = \left (a^2-b^2\right ) x+\frac {b^2 \tan (c+d x)}{d}+(2 a b) \int \tan (c+d x) \, dx \\ & = \left (a^2-b^2\right ) x-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.12 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.77 \[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {-i \left ((a+i b)^2 \log (i-\tan (c+d x))-(a-i b)^2 \log (i+\tan (c+d x))\right )+2 b^2 \tan (c+d x)}{2 d} \]
[In]
[Out]
Time = 0.78 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.13
method | result | size |
derivativedivides | \(\frac {a^{2} \left (d x +c \right )-2 a b \ln \left (\cos \left (d x +c \right )\right )+b^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(44\) |
default | \(\frac {a^{2} \left (d x +c \right )-2 a b \ln \left (\cos \left (d x +c \right )\right )+b^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(44\) |
parts | \(\frac {a^{2} \left (d x +c \right )}{d}+\frac {b^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}+\frac {2 a b \ln \left (\sec \left (d x +c \right )\right )}{d}\) | \(49\) |
risch | \(2 i a b x +a^{2} x -x \,b^{2}+\frac {4 i a b c}{d}+\frac {2 i b^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(69\) |
parallelrisch | \(\frac {2 a b \ln \left (\sec \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \cos \left (d x +c \right )-2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \cos \left (d x +c \right )-2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \cos \left (d x +c \right )+d x \left (a -b \right ) \left (a +b \right ) \cos \left (d x +c \right )+\sin \left (d x +c \right ) b^{2}}{d \cos \left (d x +c \right )}\) | \(107\) |
norman | \(\frac {\left (-a^{2}+b^{2}\right ) x +\left (-a^{2}+b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (a^{2}-b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (a^{2}-b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-\frac {2 b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {2 b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right ) \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {2 a b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}+\frac {2 a b \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{d}\) | \(225\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.54 \[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {{\left (a^{2} - b^{2}\right )} d x \cos \left (d x + c\right ) - 2 \, a b \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) + b^{2} \sin \left (d x + c\right )}{d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\int \left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{2} \sec ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.48 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.26 \[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {{\left (d x + c\right )} a^{2} - {\left (d x + c - \tan \left (d x + c\right )\right )} b^{2} - a b \log \left (-\sin \left (d x + c\right )^{2} + 1\right )}{d} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.13 \[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {a b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + b^{2} \tan \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} {\left (d x + c\right )}}{d} \]
[In]
[Out]
Time = 23.22 (sec) , antiderivative size = 118, normalized size of antiderivative = 3.03 \[ \int \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {2\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {2\,a\,b\,\ln \left (\frac {\cos \left (c+d\,x\right )}{\cos \left (c+d\,x\right )+1}\right )}{d}+\frac {2\,a\,b\,\ln \left (\frac {1}{{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )}{d} \]
[In]
[Out]